/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2022-2023. All rights reserved.
 */

package common

// Registration Request
type RegistrationRequest struct {
	Name                  string `json:"userName" validate:"required"`
	Password              string `json:"password" validate:"required"`
	VerificationCode      string `json:"captcha"`
	PhoneNumber           string `json:"phoneNumber"`
	PhoneVerificationCode string `json:"phoneVerificationCode"`
}

// Login Request
type LoginRequest struct {
	Account          string `json:"userName" validate:"required,min=1"`
	Password         string `json:"password" validate:"required,min=1"`
	VerificationCode string `json:"captcha" validate:"required,min=1"`
}

// Log out Request
type LogoutRequest struct {
	UserId string `json:"userId" validate:"required"`
}

// Change Password Request
type ChangePassRequest struct {
	UserId  string `json:"userId" validate:"required"`
	OldPass string `json:"oldPass" validate:"required"`
	NewPass string `json:"newPass" validate:"required"`
}

// Upload file
type UploadFileRequest struct {
	UserId   string `form:"userId" validate:"required"`
	FileType int    `form:"fileType" validate:"required"`
}

// RealName Request
type RealNameAuthenticationRequest struct {
	UserId           string `json:"userId" validate:"required"`
	VerificationName string `json:"verificationName" validate:"required"`
	VerificationId   string `json:"verificationId" validate:"required"`
}

// AddProductionRequest body
type AddProductionRequest struct {
	UserId      string              `json:"userId"    validate:"required"`
	AddProducts []AddProductionInfo `json:"products"`
}

// ProductionType资源有两种：1.平台自销售资源，2.云上资源
// TitleName一级目录资源
// ProductionName 资源名称
// IframeURL跳转页面,仅云上资源有效
type AddProductionInfo struct {
	TitleName      string  `json:"titleName" validate:"required"`
	ProductionType string  `json:"productionType" validate:"required"`
	ProductionName string  `json:"productionName" validate:"required"`
	IframeURL      string  `json:"iframeURL" validate:"max=2048"`
	Price          float64 `json:"price"`
}

// DeleteProductionRequest body
type DeleteProductionRequest struct {
	UserId       string `json:"userId"    validate:"required"`
	ProductionId string `json:"productionId" validate:"required"`
}

// BalanceRecharge Request body
type BalanceRechargeRequest struct {
	UserId        string  `json:"userId"    validate:"required"`
	PaymentMethod string  `json:"paymentMethod" validate:"required"`
	PaymentAmount float64 `json:"paymentAmount" validate:"required"`
	CouponId      string  `json:"couponId"`
}

// BalanceChangeRecordQuery Request body
type BalanceChangeRecordQueryRequest struct {
	UserId             string  `json:"userId"    validate:"required"`
	OperationType      *int    `json:"operationType"`
	OperationTimeBegin *int64  `json:"operationTimeBegin"`
	OperationTimeEnd   *int64  `json:"operationTimeEnd"`
	BalanceRecordId    *string `json:"balanceRecordId"`
	Page               *int    `json:"page"`
	PageSize           *int    `json:"pageSize"`
	TimeReverseOrder   *bool   `json:"timeReverseOrder"`
}

// request one pay order body
// OrderType 订单类型： 1：开通2：续订3：变更4：退订11：按需转包年/包月13：试用14：转商用15：费用调整
// OrderStatus订单状态： 1：待审核2：待退款3：处理中4：已取消5：已完成6：待支付9：待确认10：待发货11：待收货12：待上门取货13：换新中
// TimeRange 时间范围：1：最近1个月，2：最近3个月，3：最近6个月，4：最近1年，5 全部查询
type OrderOnePayQueryRequest struct {
	UserId           string  `json:"userId"    validate:"required"`
	OrderId          *string `json:"orderId"`
	Page             *int    `json:"page"`
	PageSize         *int    `json:"pageSize"`
	OrderType        []int32 `json:"orderType"`
	OrderStatus      []int32 `json:"orderStatus"`
	TimeRange        *int    `json:"timeRange"`
	TimeReverseOrder *bool   `json:"timeReverseOrder"`
}

// request on Demand order body
// OrderType 订单类型： 1：开通 ,2 :变更
// OrderStatus订单状态： 1: 已完成
type OrderOnDemandQueryRequest struct {
	UserId           string  `json:"userId"    validate:"required"`
	OrderId          *string `json:"orderId"`
	Page             *int    `json:"page"`
	PageSize         *int    `json:"pageSize"`
	OrderType        []int32 `json:"orderType"`
	CreatedTimeBegin *int64  `json:"createdTimeBegin"`
	CreatedTimeEnd   *int64  `json:"createdTimeEnd"`
	TimeReverseOrder *bool   `json:"timeReverseOrder"`
}

// 包周期订单支付
type PayOnePayOrderRequest struct {
	UserId   string   `json:"userId"  validate:"required"`
	OrderId  string   `json:"orderId" validate:"required"`
	CouponId []string `json:"couponId"`
}

// 包周期订单取消
type CancelOnePayOrderRequest struct {
	UserId  string `json:"userId"  validate:"required"`
	OrderId string `json:"orderId" validate:"required"`
}

// 流水账单查询
type QueryBillCommonRequest struct {
	BillCycle        string   `json:"billCycle"  validate:"required,min=1"`
	UserId           string   `json:"userId"  validate:"required,min=1"`
	BillId           []string `json:"bid"`
	OrderId          []string `json:"orderId"`
	ChargeMode       []int32  `json:"chargeMode"`
	BillType         []int32  `json:"billType"`
	BillStatus       []int32  `json:"billStatus"`
	TradeTimeBegin   *int64   `json:"tradeTimeBegin"`
	TradeTimeEnd     *int64   `json:"tradeTimeEnd"`
	Page             *int     `json:"page"`
	PageSize         *int     `json:"pageSize"`
	TimeReverseOrder *bool    `json:"timeReverseOrder"`
}

type QueryBillRequestForAdmin struct {
	QueryUserId  []string `json:"queryUserId" validate:"required,min=1"`
	PlatformType []string `json:"platformType"`
	QueryBillCommonRequest
}

// ///////////////////////////////////////////////////////////////////////////////

type OrderReq struct {
	OrderId       string `json:"orderId"`
	UserId        string `json:"userId"`
	PaymentMethod string `json:"paymentMethod"`
}
type AddOrUpdateUserReq struct {
	Users []string `json:"users"`
	Type  int      `json:"type"`
}

type DelUserReq struct {
	Users []string `json:"users"`
}

type LoginByPhoneReq struct {
	PhoneNum         string `json:"phoneNum"`
	VerificationCode string `json:"verificationCode"`
}

type UpdatePhoneNumReq struct {
	UserId                string `json:"userId"`
	PhoneNumber           string `json:"phoneNumber"`
	PhoneVerificationCode string `json:"phoneVerificationCode"`
}

type VerifyPhoneNumReq struct {
	PhoneNum string `json:"phoneNum"`
	IsReg    bool   `json:"isReg"`
}

type UnsubscribeReq struct {
	Password string `json:"password"`
}

type LockAndUnlockUserReq struct {
	UserId string `json:"userid"`
}
